use return value of domain_adjust_tot_pages() where feasible
authorJan Beulich <jbeulich@suse.com>
Tue, 3 Dec 2013 11:41:54 +0000 (12:41 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 3 Dec 2013 11:41:54 +0000 (12:41 +0100)
commit69a13bafe6bc9f76a06ff423d7fd52aa6016001f
tree44d180c90573591075b9cb7ee92966e7933385b8
parentd4837a56da4a59259dd0cf9f3bdc073159d81d7a
use return value of domain_adjust_tot_pages() where feasible

This is generally cheaper than re-reading ->tot_pages.

While doing so I also noticed an improper use (lacking error handling)
of get_domain() as well as lacks of ->is_dying checks in the memory
sharing code, which the patch fixes at once. In the course of doing
this I further noticed other error paths there pointlessly calling
put_page() et al with ->page_alloc_lock still held, which is also being
reversed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/mm/mem_sharing.c
xen/common/memory.c
xen/common/page_alloc.c